<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Yaf_Application class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="yaf.appconfig.html">Application Configuration</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="yaf-application.app.html">Yaf_Application::app</a></div>
 <div class="up"><a href="book.yaf.html">Yaf</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.yaf-application" class="reference">

 <h1 class="title">The Yaf_Application class</h1>
 
 

 <div class="partintro"><p class="verinfo">(No version information available, might only be in Git)</p>


  <div class="section" id="yaf-application.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    <a href="class.yaf-application.html" class="classname">Yaf_Application</a>为应用提供了一个辅助设施。
    它提供了可重用的资源，常见的和模块化的引导类，还有依赖的检查。
   </p>
   <p class="para">
    <blockquote class="note"><p><strong class="note">Note</strong>: 
     <p class="para">
       <a href="class.yaf-application.html" class="classname">Yaf_Application</a>实现了单例模式。
       <a href="class.yaf-application.html" class="classname">Yaf_Application</a>不能够被序列化和反序列化，
       因为当你尝试使用PHPUnit来为Yaf写一些测试用例的时候会造成一些不必要的麻烦。
      </p>
      <p class="para">
        你可以使用PHPUnit的@backupGlobals注释来控制全局变量的备份和恢复操作，
        从而可以解决这个问题。
     </p>
    </p></blockquote>
   </p>
  </div>


  <div class="section" id="yaf-application.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">final</span>
      <a href="class.yaf-application.html" class="classname">Yaf_Application</a>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">protected</span>
      <var class="varname"><a href="class.yaf-application.html#yaf-application.props.config">$<var class="varname">config</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">protected</span>
      <var class="varname"><a href="class.yaf-application.html#yaf-application.props.dispatcher">$<var class="varname">dispatcher</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">protected</span>
     <span class="modifier">static</span>
      <var class="varname"><a href="class.yaf-application.html#yaf-application.props.app">$<var class="varname">_app</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">protected</span>
      <var class="varname"><a href="class.yaf-application.html#yaf-application.props.modules">$<var class="varname">_modules</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">protected</span>
      <var class="varname"><a href="class.yaf-application.html#yaf-application.props.running">$<var class="varname">_running</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">protected</span>
      <var class="varname"><a href="class.yaf-application.html#yaf-application.props.environ">$<var class="varname">_environ</var></a></var>
    ;</div>


    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">void</span><span class="methodname"><a href="yaf-application.app.html" class="methodname">app</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="yaf-application.bootstrap.html" class="methodname">bootstrap</a></span>
    ([ <span class="methodparam"><span class="type"><a href="class.yaf-bootstrap-abstract.html" class="type Yaf_Bootstrap_Abstract">Yaf_Bootstrap_Abstract</a></span> <code class="parameter">$bootstrap</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">Yaf_Application</span><span class="methodname"><a href="yaf-application.clearlasterror.html" class="methodname">clearLastError</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">private</span> <span class="type">void</span><span class="methodname"><a href="yaf-application.clone.html" class="methodname">__clone</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span><span class="methodname"><a href="yaf-application.construct.html" class="methodname">__construct</a></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$config</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$envrion</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="yaf-application.destruct.html" class="methodname">__destruct</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="yaf-application.environ.html" class="methodname">environ</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="yaf-application.execute.html" class="methodname">execute</a></span>
    ( <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$entry</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$...</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">Yaf_Application</span><span class="methodname"><a href="yaf-application.getappdirectory.html" class="methodname">getAppDirectory</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">Yaf_Config_Abstract</span><span class="methodname"><a href="yaf-application.getconfig.html" class="methodname">getConfig</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">Yaf_Dispatcher</span><span class="methodname"><a href="yaf-application.getdispatcher.html" class="methodname">getDispatcher</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="yaf-application.getlasterrormsg.html" class="methodname">getLastErrorMsg</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="yaf-application.getlasterrorno.html" class="methodname">getLastErrorNo</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="yaf-application.getmodules.html" class="methodname">getModules</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="yaf-application.run.html" class="methodname">run</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">Yaf_Application</span><span class="methodname"><a href="yaf-application.setappdirectory.html" class="methodname">setAppDirectory</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$directory</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">private</span> <span class="type">void</span><span class="methodname"><a href="yaf-application.sleep.html" class="methodname">__sleep</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">private</span> <span class="type">void</span><span class="methodname"><a href="yaf-application.wakeup.html" class="methodname">__wakeup</a></span>
    ( <span class="methodparam">void</span>
   )</div>

   }</div>


  </div>

  

  <div class="section" id="yaf-application.props">
   <h2 class="title">属性</h2>
   <dl>

    
     <dt id="yaf-application.props.config"><var class="varname"><var class="varname">config</var></var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
    
     <dt id="yaf-application.props.dispatcher"><var class="varname"><var class="varname">dispatcher</var></var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
    
     <dt id="yaf-application.props.app"><var class="varname"><var class="varname">_app</var></var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
    
     <dt id="yaf-application.props.modules"><var class="varname"><var class="varname">_modules</var></var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
    
     <dt id="yaf-application.props.running"><var class="varname"><var class="varname">_running</var></var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
    
     <dt id="yaf-application.props.environ"><var class="varname"><var class="varname">_environ</var></var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
   </dl>

  </div>



 </div>

 































































































































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="yaf-application.app.html">Yaf_Application::app</a> — 获取当前的Yaf_Application实例</li><li><a href="yaf-application.bootstrap.html">Yaf_Application::bootstrap</a> — 调用bootstrap</li><li><a href="yaf-application.clearlasterror.html">Yaf_Application::clearLastError</a> — 清除最后的错误信息</li><li><a href="yaf-application.clone.html">Yaf_Application::__clone</a> — Yaf_Application不能被克隆</li><li><a href="yaf-application.construct.html">Yaf_Application::__construct</a> — Yaf_Application的构造函数</li><li><a href="yaf-application.destruct.html">Yaf_Application::__destruct</a> — 析构函数</li><li><a href="yaf-application.environ.html">Yaf_Application::environ</a> — 获取当前Yaf_Application的环境名</li><li><a href="yaf-application.execute.html">Yaf_Application::execute</a> — 运行回调函数</li><li><a href="yaf-application.getappdirectory.html">Yaf_Application::getAppDirectory</a> — 获取应用的目录</li><li><a href="yaf-application.getconfig.html">Yaf_Application::getConfig</a> — 获取 Yaf_Config_Abstract 的实例</li><li><a href="yaf-application.getdispatcher.html">Yaf_Application::getDispatcher</a> — 获取 Yaf_Dispatcher 的实例</li><li><a href="yaf-application.getlasterrormsg.html">Yaf_Application::getLastErrorMsg</a> — 获取最近产生的错误的错误信息</li><li><a href="yaf-application.getlasterrorno.html">Yaf_Application::getLastErrorNo</a> — 获取最后产生的错误的错误代码</li><li><a href="yaf-application.getmodules.html">Yaf_Application::getModules</a> — 获取在配置文件中申明的模块</li><li><a href="yaf-application.run.html">Yaf_Application::run</a> — 运行 Yaf_Application</li><li><a href="yaf-application.setappdirectory.html">Yaf_Application::setAppDirectory</a> — 改变应用目录</li><li><a href="yaf-application.sleep.html">Yaf_Application::__sleep</a> — Yaf_Application 不能被序列化</li><li><a href="yaf-application.wakeup.html">Yaf_Application::__wakeup</a> — Yaf_Application 不能被反序列化</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="yaf.appconfig.html">Application Configuration</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="yaf-application.app.html">Yaf_Application::app</a></div>
 <div class="up"><a href="book.yaf.html">Yaf</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
